<?php

use app\widgets\HelloWidget;
use yii\helpers\Html;
use yii\widgets\DetailView;

/** @var yii\web\View $this */
/** @var app\models\Country $model */

//这是页面标题
$this->title = $model->name;
// 面包屑 导航栏   url 对应的是调转的地址
$this->params['breadcrumbs'][] = ['label' => 'Countries', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);

//var_dump($this->context->id);die;

?>
<div class="country-view">
<!-- 自定义小部件 -->
    <h3><?= HelloWidget::widget(['message' => '我是自定义的小部件'])?></h3>

<!--    获取上下文中的参数 -->
    <h2><?= $this->context->id ?></h2>

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('Update', ['update', 'code' => $model->code], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'code' => $model->code], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'code',
            'name',
            'population',
        ],
    ]) ?>

</div>
